package com.tofacebook.spring.model;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Slf4j
public class Dept  implements SonDept{
    private Integer deptId;
    private String deptName;


    /**
     * @Slf4j 的底层实现相当于
     * private final static Logger log =
     *             LoggerFactory.getLogger(Dept.class);
     */
//    private final static Logger log =
//            LoggerFactory.getLogger(Dept.class);
    public void readDept(){
        //使用log去输出日志信息
        int i = 0;
        log.info("获取i的值：{}",++i);//info 日志信息
        /*log.warn()//警告信息
        log.error(); //错误日志信息
        log.debug(); //debug级别的日志信息*/
        //上面一行代码相当于System.out.println("获取i的值:"+ i);
    }

    public Integer getDeptId() {
        return deptId;
    }

    public void setDeptId(Integer deptId) {
        this.deptId = deptId;
    }

    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    public Dept() {
    }

    public Dept(int deptId,String deptName) {
        this.deptId = deptId;
        this.deptName = deptName;
    }

    public void getSonDept() {
        log.info("fdsfasdf:{}",0);
    }

    @Override
    public String toString() {
        return "Dept{" +
                "deptId=" + deptId +
                ", deptName='" + deptName + '\'' +
                '}';
    }
}
